package java_DesignPattern.SixPrinciple.InterfaceSegregationPrinciple.Defualt;

/**
 * 接口隔离原则默认测试类
 * 接口隔离: 客户端不应该依赖它不需要的接口
 */
public class Test {
    public static void main(String[] args) {
        //创建黑马安全门对象
        HeiMaSafetyDoor heiMaSafetyDoor = new HeiMaSafetyDoor();
        heiMaSafetyDoor.antiTheft();
        heiMaSafetyDoor.fireproof();
        heiMaSafetyDoor.waterproof();

        //创建川智安全门对象
        ChuanZhiDoor chuanZhiDoor = new ChuanZhiDoor();
        chuanZhiDoor.antiTheft();
        chuanZhiDoor.fireproof();
        //川智安全门没有防水方法，所以调用时会报错
        chuanZhiDoor.waterproof();
    }
}
